//package com.smartleanx.module.hrm.service.examine.util;
//
//import cn.hutool.json.JSONObject;
//import com.alibaba.nacos.client.naming.utils.CollectionUtils;
//import org.apache.poi.ss.usermodel.Cell;
//import org.apache.poi.ss.usermodel.Row;
//import org.apache.poi.xssf.streaming.SXSSFSheet;
//import org.apache.poi.xssf.usermodel.XSSFWorkbook;
//
//import javax.servlet.ServletOutputStream;
//import javax.servlet.http.HttpServletResponse;
//import java.time.format.DateTimeFormatter;
//import java.util.ArrayList;
//import java.util.List;
//
//public class ExcelUtil {
//    //设置表格数据
//    public static void export(SXSSFSheet sheetOne,List<String> heads,List<JSONObject> answerList,String title,String status){
//        setHeaderData(sheetOne,heads);
//        if(!CollectionUtils.isEmpty(answerList)){
//            Row dataRow =null;
//            int num=1;
//            for(JSONObject answer:answerList){
//                dataRow = sheetOne.createRow(num);
//                Cell cell = dataRow.createCell(0);
//                cell.setCellValue(answer.getPhone());
//                cell = dataRow.createCell(1);
//                cell.setCellValue(title);
//                cell = dataRow.createCell(2);
//                cell.setCellValue(answer.getNickName());
//                cell = dataRow.createCell(3);
//                cell.setCellValue(status);
//                cell = dataRow.createCell(4);
//                cell.setCellValue(answer.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
//                JSONObject jsonObject=JSONObject.parseObject(answer.getAnswers());
//                for(int questionNum=0;questionNum<(heads.size()-5);questionNum++){
//                    cell = dataRow.createCell(5+questionNum);
//                    cell.setCellValue(jsonObject.getString(String.valueOf(questionNum+1)));
//                }
//                num++;
//            }
//        }
//    }
//    //设置表头
//    private static void setHeaderData(SXSSFSheet sheetOne,List<String> heads) {
//        Row row = sheetOne.createRow(0);
//        int num=0;
//        for (String head:heads) {
//            Cell cell = row.createCell(num);
//            cell.setCellValue(head);
//            num++;
//        }
//    }
//}
//
//
//}
